/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.IOException;

/**
 * <p>Project: javaseapp - Dir7
 * <p>Powered by webrx On 2021-08-11 11:30:08
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Dir7 {
    public static void main(String[] args) throws IOException {
        //会根据系统自动的返回值  windows \\ linux /
        //System.out.println(File.separator);
        //System.out.println(System.getProperty("os.name"));

        Runtime run = Runtime.getRuntime();
        //c:/c目录  中间不使用/
        String dir = "c:c";
        //判断系统
        String os = System.getProperty("os.name");
        if (os.contains("Linux")) {
            //linux mkdir a b c use/a/cc -p
            run.exec(String.format("rm -rf %s", dir));
        } else if (os.contains("Windows")) {
            run.exec(String.format("cmd /k rmdir /S /Q %s", dir));
            System.out.println("delete c");
        }
    }
}
